<template>
  <view>
    <u-toast ref="uToast"/>
    <view class="top-bg"/>
    <view class="box">
      <!-- 头像 -->
      <view class="head-box">
        <!--已登录头像框-->
        <view v-if="ownerName !== ''">
          <button @chooseavatar="avatarUpload" open-type="chooseAvatar" class="avatar">
            <image v-if="ownerAvatar === ''"
                   src="https://fyiereguio-wisdom.oss-cn-hangzhou.aliyuncs.com/image/my-noLogin.jpg"
                   mode="scaleToFill" class="head-img"/>
            <image v-if="ownerAvatar !== ''"
                   :src="ownerAvatar"
                   mode="scaleToFill" class="head-img"/>
          </button>
          <view class="tip">欢迎！{{ ownerName }}</view>
        </view>
        <!--未登录头像框-->
        <view v-if="ownerName === ''">
          <button @click="routerLogin" class="avatar">
            <image src="https://fyiereguio-wisdom.oss-cn-hangzhou.aliyuncs.com/image/my-noLogin.jpg"
                   mode="widthFix" class="head-img"/>
          </button>
          <view class="tip">当前未登录，请登录！</view>
        </view>
      </view>

      <!-- 第一部分列表 -->
      <view class="end">
        <button v-if="ownerName === ''"
                @click="routerLogin"
                class="row" style="width: 100%;border-bottom: none;">
          <view class="left">
            <u-icon name="man-add" color="#909399" size="25"/>
            <text class="text">立即登录</text>
          </view>
        </button>
        <button class="row" bindtap="basicClick" style="width: 100%;">
          <view class="left">
            <u-icon name="account" color="#909399" size="25"/>
            <text class="text">基本信息</text>
          </view>
        </button>
        <button class="row" style="width: 100%;" bindtap="feedbackClick">
          <view class="left">
            <u-icon name="eye-fill" color="#909399" size="25"/>
            <text class="text">匿名反馈</text>
          </view>
        </button>
      </view>

      <!-- 第二部分列表 -->
      <view class="end">
        <button open-type="share" class="row" style="width: 100%;">
          <view class="left">
            <u-icon name="share-square" color="#909399" size="25"/>
            <text class="text">分享好友</text>
          </view>
        </button>
        <button open-type="contact" class="row" style="width: 100%;border-bottom: none;">
          <view class="left">
            <u-icon name="kefu-ermai" color="#909399" size="25"/>
            <text class="text">在线客服</text>
          </view>
        </button>
        <navigator url="/pages/my/about/About" open-type="navigate"
                   class="row" style="width: 100%">
          <view class="left">
            <u-icon name="info-circle" color="#909399" size="25"/>
            <text class="text">关于我们</text>
          </view>
        </navigator>
        <button v-if="ownerName !== ''"
                @click="outLogin" bindtap="exitClick" class="row" style="width: 100%;border-bottom: none;">
          <view class="left">
            <u-icon name="close" color="#909399" size="25"/>
            <text class="text">退出登录</text>
          </view>
        </button>
      </view>
    </view>

    <view class="footer">
      <text>©个人中心</text>
    </view>

  </view>
</template>

<script>
import MyViewJs from './MyView'

export default MyViewJs
</script>

<style>
@import url(MyView.css);
</style>
